<?php
class User extends MySQLCN{
 	function login() {
 		if($_POST['login'] == NULL || $_POST['password'] == NULL){
 			return false;
 		}
		$pass = md5($_POST['password']);
 		$qry = "SELECT * 
 				FROM users 
 				WHERE Login = '{$_POST['login']}' AND Password = '{$pass}'";
		$result = $this->select($qry);
		if($result != NULL){
			$_SESSION['SESS_MEMBER_ID'] = $result[0]['id'];
			$_SESSION['LOGIN'] = $result[0]['Login'];
			
			//$_SESSION['SESS_MEMBER_ID'] = $member['id'];
			//$_SESSION['LOGIN'] = $member['Login'];
			return true;
		}else{
			return false;
		}
 	}
	
	
}
?>